package com.mashuai.utils.ztest.pb.bean;

import com.baomidou.mybatisplus.annotation.*;

import com.mashuai.utils.toolkit.core.msCrudbean.annotation.MsCrudBean;
import com.mashuai.utils.toolkit.core.msCrudbean.annotation.MsTbForderField;
import com.mashuai.utils.toolkit.core.msHandlebean.annotation.*;
import com.mashuai.utils.ztest.toolkit.msCrud.MsCrudBeanService;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName: MsUser
 * @Description:用户表
 */
@Data
@TableName("ms_user")
@MsCrudBean(targetParam = "msUser",entityClazz = MsUser.class,serviceClazz = MsCrudBeanService.class)
public class MsUser implements Serializable {
    @MsDictSelect(alias = "code")
    @TableId("id")
    private String id;

    @TableField("name")
    private String name;

    @TableField("sex")
    private String sex;

    @TableField("code")
    private String code;
/*
    @TableField(fill = FieldFill.INSERT)
    private String creator;
    @TableField(value = "create_time")
    private Date createTime;
    @TableField(value = "update_by")
    private String updateBy;
    @TableField(value = "update_time")
    private Date updateTime;

    @TableLogic
    private String deflag;

    @MsDictSelect(alias = "label")
    @MsSaveCheck
    private String name;
    //入住的房间id，反查出房间号、楼层、楼栋信息
    @MsJoinMoreTables({
            @MsJoinTable(joinTable = "ms_room", moreJoinCondition = "room_id@id",needFields = "type@roomType"),
            @MsJoinTable(joinTable = "ms_floor", moreJoinCondition = "floor_id@id", needFields = {"name@floorName","id@floorId"}),
            @MsJoinTable(joinTable = "ms_building", moreJoinCondition = "building_id@id", needFields = {"name@buildName","remark@buildRemark","id@buildId"})
    })
    @TableField(value = "room_id")
    private String roomId;
    @TableField(exist = false)
    private String roomName;
    @TableField(exist = false)
    private String roomType;
    @TableField(exist = false)
    private String floorName;
    @TableField(exist = false)
    private String floorId;
    @TableField(exist = false)
    private String buildName;
    //人员类型 0-户主，1-租客，字典类型为：userType
    @MsTbForderField
    @MsJoinDict(dictType = "userType",setField = "type")
    private String type;
    private String remark;
    @TableField(exist = false)
    private String buildRemark;
    @TableField(exist = false)
    private String buildId;*/

}
